package com.atguigu.admin.filter;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpFilter;
import java.io.IOException;

/**
 * @author 杨林
 * @create 2023-08-31 10:04 星期四
 * description:
 */
@Slf4j
//@WebFilter
public class MyFilter implements Filter {


    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        log.info("MyFilter初始化了");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        log.info("MyFilter开始发力");
        chain.doFilter(request,response);   //放行
    }

    @Override
    public void destroy() {
        log.info("MyFilter销毁了");
    }
}
